package com.my.study.guava;

import com.google.common.util.concurrent.RateLimiter;
import org.junit.Test;

/**
 * @author Carlos
 * @version 1.0.0
 * @date 2022/3/23 23:03
 */
public class RateLimiterTest {

    @Test
    public void testSmoothBursty() {
        RateLimiter rateLimiter = RateLimiter.create(5);

        while (true) {
            System.out.println("get 1 tokens: " + rateLimiter.acquire() + "s");
        }


    }

}
